




/*
'===============================================================================
'  MP.LayerHelper.MP_OBS.BL.HrPositionManagerBase
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.DAL.FactoryClasses;
using MP.LayerHelper.MP_OBS.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace MP.LayerHelper.MP_OBS.BLL
{
	public class HrPositionManagerBase : ManagerBase
	{
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		
		public HrPositionManagerBase()
		{
			// Nothing for now.
		}
		
		public override string TableName()
        {
            return "HrPosition";
        }
		
		public HrPositionEntity Insert(HrPositionEntity _HrPositionEntity)
		{
			return Insert(_HrPositionEntity, "");
		}
		
		public HrPositionEntity Insert(HrPositionEntity _HrPositionEntity, string controlId)
		{
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.SaveEntity(_HrPositionEntity, true);
				HrPositionFields field = new HrPositionFields();
                LogEntity(_HrPositionEntity, field, AcInsert, controlId);
			}
			return _HrPositionEntity;
		}

		
		public HrPositionEntity Insert(Guid Id, Guid OrganizeId, string UserId, bool IsEnable, bool IsMaster, string CreatedBy, DateTime CreatedDate, string UpdatedBy, DateTime UpdatedDate, bool IsDeleted, Guid EmployeeId)
		{
			HrPositionEntity _HrPositionEntity = new HrPositionEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_HrPositionEntity.Id = Id;
				_HrPositionEntity.OrganizeId = OrganizeId;
				_HrPositionEntity.UserId = UserId;
				_HrPositionEntity.IsEnable = IsEnable;
				_HrPositionEntity.IsMaster = IsMaster;
				_HrPositionEntity.CreatedBy = CreatedBy;
				_HrPositionEntity.CreatedDate = CreatedDate;
				_HrPositionEntity.UpdatedBy = UpdatedBy;
				_HrPositionEntity.UpdatedDate = UpdatedDate;
				_HrPositionEntity.IsDeleted = IsDeleted;
				_HrPositionEntity.EmployeeId = EmployeeId;
				HrPositionFields field = new HrPositionFields();
                LogEntity(_HrPositionEntity, field, AcInsert);
				adapter.SaveEntity(_HrPositionEntity, true);
			}
			return _HrPositionEntity;
		}

		public HrPositionEntity Insert(Guid OrganizeId, string UserId, bool IsEnable, bool IsMaster, string CreatedBy, DateTime CreatedDate, string UpdatedBy, DateTime UpdatedDate, bool IsDeleted, Guid EmployeeId)
		{
			HrPositionEntity _HrPositionEntity = new HrPositionEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_HrPositionEntity.OrganizeId = OrganizeId;
				_HrPositionEntity.UserId = UserId;
				_HrPositionEntity.IsEnable = IsEnable;
				_HrPositionEntity.IsMaster = IsMaster;
				_HrPositionEntity.CreatedBy = CreatedBy;
				_HrPositionEntity.CreatedDate = CreatedDate;
				_HrPositionEntity.UpdatedBy = UpdatedBy;
				_HrPositionEntity.UpdatedDate = UpdatedDate;
				_HrPositionEntity.IsDeleted = IsDeleted;
				_HrPositionEntity.EmployeeId = EmployeeId;
				adapter.SaveEntity(_HrPositionEntity, true);
				HrPositionFields field = new HrPositionFields();
                LogEntity(_HrPositionEntity, field, AcInsert);
			}
			return _HrPositionEntity;
		}
		
		public bool Update(HrPositionEntity _HrPositionEntity)
        {
            return Update(_HrPositionEntity, "");
        }

		public bool Update(HrPositionEntity _HrPositionEntity, string controlId)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				RelationPredicateBucket filter = new RelationPredicateBucket();
				IPredicateExpression _PredicateExpression = new PredicateExpression();
				_PredicateExpression.Add(HrPositionFields.Id == _HrPositionEntity.Id);
					
				filter.PredicateExpression.Add(_PredicateExpression);

				adapter.UpdateEntitiesDirectly(_HrPositionEntity, filter);
				toReturn = true;
				
				HrPositionFields field = new HrPositionFields();
                LogEntity(_HrPositionEntity, field, AcUpdate, controlId);
			}
			return toReturn;
		}
		
		public bool Update(HrPositionEntity _HrPositionEntity, RelationPredicateBucket filter)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.UpdateEntitiesDirectly(_HrPositionEntity, filter);
				toReturn = true;
				
				HrPositionFields field = new HrPositionFields();
                LogEntity(_HrPositionEntity, field, AcUpdate);
			}
			return toReturn;
		}

		public bool Update(Guid Id, Guid OrganizeId, string UserId, bool IsEnable, bool IsMaster, string CreatedBy, DateTime CreatedDate, string UpdatedBy, DateTime UpdatedDate, bool IsDeleted, Guid EmployeeId)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				HrPositionEntity _HrPositionEntity = new HrPositionEntity(Id);
				if (adapter.FetchEntity(_HrPositionEntity))
				{
				
					_HrPositionEntity.OrganizeId = OrganizeId;
					_HrPositionEntity.UserId = UserId;
					_HrPositionEntity.IsEnable = IsEnable;
					_HrPositionEntity.IsMaster = IsMaster;
					_HrPositionEntity.CreatedBy = CreatedBy;
					_HrPositionEntity.CreatedDate = CreatedDate;
					_HrPositionEntity.UpdatedBy = UpdatedBy;
					_HrPositionEntity.UpdatedDate = UpdatedDate;
					_HrPositionEntity.IsDeleted = IsDeleted;
					_HrPositionEntity.EmployeeId = EmployeeId;
					adapter.SaveEntity(_HrPositionEntity, true);
					toReturn = true;
					
					HrPositionFields field = new HrPositionFields();
					LogEntity(_HrPositionEntity, field, AcUpdate);
				}
			}
			return toReturn;
		}

		public bool Delete(Guid Id)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				HrPositionEntity _HrPositionEntity = new HrPositionEntity(Id);
				if (adapter.FetchEntity(_HrPositionEntity))
				{
					adapter.DeleteEntity(_HrPositionEntity);
					toReturn = true;
				}
			}
			return toReturn;
		}
		
		public void DeleteAll() 
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.DeleteEntitiesDirectly("HrPositionEntity", null);
			}
		}
		
		
		public int DeleteById(Guid Id)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByOrganizeId(Guid OrganizeId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.OrganizeId == OrganizeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUserId(string UserId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UserId == UserId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByIsEnable(bool IsEnable)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsEnable == IsEnable);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByIsMaster(bool IsMaster)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsMaster == IsMaster);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByCreatedBy(string CreatedBy)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedBy == CreatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByCreatedDate(DateTime CreatedDate)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedDate == CreatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUpdatedBy(string UpdatedBy)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedBy == UpdatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUpdatedDate(DateTime UpdatedDate)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedDate == UpdatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByIsDeleted(bool IsDeleted)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsDeleted == IsDeleted);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByEmployeeId(Guid EmployeeId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("HrPositionEntity", filter);
			}
			return toReturn;
		}
		

		
		public HrPositionEntity SelectOne(Guid Id)
		{
			HrPositionEntity toReturn = null;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				HrPositionEntity _HrPositionEntity = new HrPositionEntity(Id);
				if (adapter.FetchEntity(_HrPositionEntity))
				{
					toReturn = _HrPositionEntity;
				}
			}
			return toReturn;
		}

		// Return DataTable
		public DataTable SelectAllRDT()
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, null, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectAllLST()
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, null, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectAllLST_Paged(int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, null, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIdLST(Guid Id)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIdLST_Paged(Guid Id, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT(Guid Id)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT_Paged(Guid Id, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByOrganizeIdLST(Guid OrganizeId)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.OrganizeId == OrganizeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByOrganizeIdLST_Paged(Guid OrganizeId, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.OrganizeId == OrganizeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByOrganizeIdRDT(Guid OrganizeId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.OrganizeId == OrganizeId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByOrganizeIdRDT_Paged(Guid OrganizeId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.OrganizeId == OrganizeId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByUserIdLST(string UserId)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UserId == UserId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByUserIdLST_Paged(string UserId, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UserId == UserId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUserIdRDT(string UserId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UserId == UserId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByUserIdRDT_Paged(string UserId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UserId == UserId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIsEnableLST(bool IsEnable)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsEnable == IsEnable);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIsEnableLST_Paged(bool IsEnable, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsEnable == IsEnable);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIsEnableRDT(bool IsEnable)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsEnable == IsEnable);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIsEnableRDT_Paged(bool IsEnable, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsEnable == IsEnable);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIsMasterLST(bool IsMaster)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsMaster == IsMaster);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIsMasterLST_Paged(bool IsMaster, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsMaster == IsMaster);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIsMasterRDT(bool IsMaster)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsMaster == IsMaster);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIsMasterRDT_Paged(bool IsMaster, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsMaster == IsMaster);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByCreatedByLST(string CreatedBy)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedBy == CreatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByCreatedByLST_Paged(string CreatedBy, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedBy == CreatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByCreatedByRDT(string CreatedBy)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedBy == CreatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByCreatedByRDT_Paged(string CreatedBy, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedBy == CreatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByCreatedDateLST(DateTime CreatedDate)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedDate == CreatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByCreatedDateLST_Paged(DateTime CreatedDate, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedDate == CreatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByCreatedDateRDT(DateTime CreatedDate)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedDate == CreatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByCreatedDateRDT_Paged(DateTime CreatedDate, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.CreatedDate == CreatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByUpdatedByLST(string UpdatedBy)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedBy == UpdatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByUpdatedByLST_Paged(string UpdatedBy, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedBy == UpdatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUpdatedByRDT(string UpdatedBy)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedBy == UpdatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByUpdatedByRDT_Paged(string UpdatedBy, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedBy == UpdatedBy);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByUpdatedDateLST(DateTime UpdatedDate)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedDate == UpdatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByUpdatedDateLST_Paged(DateTime UpdatedDate, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedDate == UpdatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUpdatedDateRDT(DateTime UpdatedDate)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedDate == UpdatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByUpdatedDateRDT_Paged(DateTime UpdatedDate, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.UpdatedDate == UpdatedDate);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIsDeletedLST(bool IsDeleted)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsDeleted == IsDeleted);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByIsDeletedLST_Paged(bool IsDeleted, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsDeleted == IsDeleted);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIsDeletedRDT(bool IsDeleted)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsDeleted == IsDeleted);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIsDeletedRDT_Paged(bool IsDeleted, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.IsDeleted == IsDeleted);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByEmployeeIdLST(Guid EmployeeId)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null);
			}
			return _HrPositionCollection;
		}
		
		// Return EntityCollection<HrPositionEntity>
		public EntityCollection<HrPositionEntity> SelectByEmployeeIdLST_Paged(Guid EmployeeId, int PageNumber, int PageSize)
		{
			EntityCollection<HrPositionEntity> _HrPositionCollection = new EntityCollection<HrPositionEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_HrPositionCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _HrPositionCollection;
		}
		
		// Return DataTable
		public DataTable SelectByEmployeeIdRDT(Guid EmployeeId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByEmployeeIdRDT_Paged(Guid EmployeeId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _HrPositionCollection = new EntityCollection(new HrPositionEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(HrPositionFields.EmployeeId == EmployeeId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_HrPositionCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		

	}
}
